package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: ruchita
 * Date: 19/9/13
 * Time: 11:54 AM
 * To change this template use File | Settings | File Templates.
 */
public class ReserveBook {
    public Boolean reserveSpecifiedBook(String bookName) {
        //checking availibility in sample database
        BooksSampleDatabase s = new BooksSampleDatabase();
        s.createDatabase();
        for(String BookName:s.bookInfo.keySet())  {
            if(BookName.equalsIgnoreCase(bookName)){
                if(s.bookInfo.get(BookName).equalsIgnoreCase("A"))   //If available then returns true
                    return true;
                else
                    return false;
            }

        }
        return false;
    }
}
